import Button from "components/Base/Button";
import Icon from "components/Base/Icon";
import DataTable from "components/Base/DataTable";

export default (self) => [
  {
    title: 'id',
    name: 'id',
    formItem: {
      type: 'hidden',
    }
  },
  {
    title: '设备编号',
    name: 'deviceId',
    tableItem: {},
  },
  {
    title: '医院',
    name: 'hospitalName',
    tableItem: {},
  },
  {
    title: '天总数',
    name: 'dayCount',
    tableItem: {},
  },
  {
    title: '月总数',
    name: 'monthCount',
    tableItem: {},
  },
  {
    title: '未上传',
    name: 'notUploadCount',
    tableItem: {
      sorter: true,
    },
  },
  {
    title: '最后一次数据时间',
    name: 'lastTime',
    tableItem: {},
  },
  {
    title: '操作',
    tableItem: {
      width: 180,
      render: (text, record) => {

        const {deviceId} = record;

        var path = `/detail/data/${deviceId}`;

        return (
          <DataTable.Oper>
            <Button tooltip="详情" onClick={e => self.jump(path)}>
              <Icon antd={true} type="snippets"/>
            </Button>
          </DataTable.Oper>
        );
      }
    }
  }
]
